#include <stdio.h>
#include <math.h>
int    main()
{
    int n,t;
    scanf( "%d", &t );
    while ( t-- )
    {
        scanf( "%d", &n );
        if ( n == 0 ) break;
        printf( "%d\n", (-2 + int( sqrt( 4 + 4 * ( n -1 ) ) ) ) / 2 + 1 );
    }
    return 0;
}
